package api

import (
	"github.com/gin-gonic/gin"
	"zg3zk3/api/handler"
	"zg3zk3/pkg"
)

func LoadRouter(router *gin.Engine) {
	router = gin.Default()

	// 简单的路由组: v1
	user := router.Group("/user")
	{
		user.POST("/register", handler.Register)
		user.POST("/login", handler.Login)
	}
	Zbj := router.Group("/user")
	{
		Zbj.Use(pkg.JWTAuth("jwt"))
		Zbj.POST("/zbj", handler.Zbj)
		Zbj.POST("/zbjupdate", handler.ZbjUpdate)
		Zbj.POST("/upload", handler.ZbjUpload)

	}
	FenShi := router.Group("/user")
	{
		FenShi.Use(pkg.JWTAuth("jwt"))
		FenShi.POST("/fenshiAdd", handler.FsAdd)
		FenShi.POST("/fenshiShow", handler.FsShow)
		FenShi.POST("/fenshidel", handler.FsDelete)

	}
	router.Run(":8080")
}
